package com.example.demo.mapper;


import com.example.demo.pojo.CService;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface CServiceMapper {
    @Insert("insert into lobby(sessionid,content,time,status)"+
            "values (#{sessionid},#{content},now(),#{status})")
    void add(CService cService);

    @Select("select * from lobby")
    List<CService> findAll();

    @Select("select * from lobby where status = 1")
    List<CService> list(Integer categoryId);

    //@Select("select * from lobby where sessionid = ")

    @Update("update lobby set status = not status where sessionid = #{sessionid}")
    void update(String sessionid);


}
